import Vue from 'vue'
import router from '@/router'

/**
 * 指令跳转页面
 * @type {{bind: JLLink.bind}}
 */
const JLLink = {
  bind: function (el, binding, vnode) {
    vnode.elm.onclick = function () {
      router.push(
        {name: binding.value},
        function (v) {
        }, function (e) {
        })
    }
  }
}

export default {
  install: function () {
    Vue.directive('jl-link', JLLink)
  }
}
